Skip to content

ICU-23113 Add nullptr handle for in CollationDataBuilder::addCE32 #3486

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
wants to merge 1 commit into from

Conversation

wooffie
Copy link
Contributor

@wooffie wooffie commented Apr 24, 2025

Checklist

  • Required: Issue filed: ICU-23113
  • Required: The PR title must be prefixed with a JIRA Issue number. Example: "ICU-1234 Fix xyz"
  • Required: Each commit message must be prefixed with a JIRA Issue number. Example: "ICU-1234 Fix xyz"
  • Issue accepted (done by Technical Committee after discussion)
  • Tests included, if applicable
  • API docs and/or User Guide docs changed or added, if applicable

@FrankYFTang
Copy link
Contributor

can you add a unit test to trigger the bug if not fix?

@markusicu
Copy link
Member

It is an invariant that a FALLBACK_CE32 only occurs in a delta (tailoring) table, which only functions with a non-nullptr base pointer to the root table. A FALLBACK_CE32 means that the delta table has no data for a character, and without the base it could not process that character.

From icu4c/source/i18n/collation.h:

    /**
     * A CE32 is special if its low byte is this or greater.
     * Impossible case bits 11 mark special CE32s.
     * This value itself is used to indicate a fallback to the base collator.
     */
    static const uint8_t SPECIAL_CE32_LOW_BYTE = 0xc0;
    static const uint32_t FALLBACK_CE32 = SPECIAL_CE32_LOW_BYTE;

@markusicu markusicu closed this May 29, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants